﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WeChartWorkRobot.Common;
using WeChartWorkRobot.Model;

namespace WeChartWorkRobot.Service.CustomerMsg
{
    public abstract class SendCustomerMsgBase
    {
        public abstract string getContent();

        JiraConfig _jiraConfig;
        protected JiraConfig jiraConfig
        {
            get
            {
                if (_jiraConfig == null)
                {
                    string filePath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, ConstService.APP_DATA_PATH, ConstService.JIRA_CONFIG_PATH);
                    _jiraConfig = XmlHelper.XmlDeserializeFromFile<JiraConfig>(filePath);
                    _jiraConfig.JiraHost = _jiraConfig.JiraHost.TrimEnd(new char[] { '\\', '/' });
                }
                return _jiraConfig;
            }
        }
    }
}
